using Xtensive.Orm;

namespace SalesPoint.Model
{
  [KeyGenerator(KeyGeneratorKind.None)]
  [TableMapping("OrderDetails")]
  [HierarchyRoot]
  public class OrderDetails : Entity
  {
    [Field, Key(0)]
    public Order Order { get; private set; }

    [Field, Key(1)]
    public Product Product { get; private set; }

    [Field]
    public decimal UnitPrice { get; set; }

    [Field]
    public short Quantity { get; set; }

    [Field]
    public float Discount { get; set; }


    // Constructors

    public OrderDetails(Session session, Order order, Product product)
      : base(session, order, product)
    {
    }
  }
}